// pages/coach_intro/coach_intro.js
const app = getApp()
Page({
  data: {
    coachInfo:[]
  },

  onLoad: function (options) {
    let that = this
    console.log(options.id)
    wx.request({
      url: app.url + '/weiapp/api/getCoachDetail',
      data: { id: options.id },
      success: function (res) {
        if (res.data.code != 200) {
          wx.showToast({
            title: '错误代码:' + res.data.code,
            icon: 'none',
            duration: 5000
          })
        }
        else {
          that.setData({
            coachInfo: res.data.data
          })
        }
      }
    })    
  },
})